﻿using MongoDbRepository.Specifications;
using Repository;
using Repository.entity;
using Repository.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MongoDbRepository
{
    public class UserRepository : MongoDBRepository<User>, IUserRepository
    {

        public UserRepository(IRepositoryContext context)
         : base(context)
        { }

        public bool UserNameExists(string userName)
        {
            return Exists(new UserNameEqualsSpecification(userName));
        }


        public void Add()
        {
             DoAdd(new User() { Email = "xxxx@sina.com", ID = new Guid(), Password = "ss", UserName = "sxs" });
        }

    }
}
